<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>用户注册</title>
	<link rel="icon" href="../../img/icon.png" type="image/x-icon"/>
	<link rel="stylesheet" type="text/css" href="../../css/mui.css"/>
	<link rel="stylesheet" type="text/css" href="../../css/mui.min.css"/>
	<link rel="stylesheet" type="text/css" href="../../css/app.css"/>
</head>
<body>
<!-- 顶部菜单 -->
<ul id="top">
	<li class="addBug back" onclick="mui.back();">返回</li>
	<li class="addBug">&nbsp;</li>
	<li class="addBug">&nbsp;</li>
</ul>
<!-- 主体 -->
<div style="height: 50px;"></div>
<div class="form">
	<h2>用户注册</h2>
	<input type="text" id="domain" placeholder="域名" value="http://bug.jiuge_mc.com"/>
	<input type="button"  value="保存" onclick="setDomain()"/>
</div>
<div style="height: 50px;"></div>
<!-- <form class="mui-input-group" >
    <div class="mui-input-row">
        <label>用户名</label>
    <input type="text" class="mui-input-clear" placeholder="请输入用户名">
    </div>
    <div class="mui-input-row">
        <label>密码</label>
        <input type="password" class="mui-input-password" placeholder="请输入密码">
    </div>
    <div class="mui-button-row">
        <button type="button" class="mui-btn mui-btn-primary" >确认</button>
        <button type="button" class="mui-btn mui-btn-danger" >取消</button>
    </div>
</form> -->
<!-- 底部菜单 -->
<ul id="foot">
	<li class="noclick" onclick="jumpToIndex()">BUG</li>
	<li class="noclick" onclick="jumpToHistory()">历史</li>
	<li class="noclick" onclick="jumpToMore()">更多</li>
	<li onclick="jumpToMy()">我的</li>
</ul>
</body>
</html>


<script type="text/javascript" src="../../js/mui.min.js"></script>
<script type="text/javascript" src="../../js/app.js"></script>
<script type="text/javascript">
	(function($, owner) {
		// mui.plusReady(function() {
		// 	localStorage.clear(); //清除缓存
		// 	//1.把数组转换为对象存入
		// 	var domainKey = 'domainKey';
		// 	var domainVal = 'http://bug.jiuge_mc.com';
		// 	var domainStr = JSON.stringify(domainVal);
		// 	localStorage.setItem(domainKey,domainStr);
		// 	//2.获取缓存	
		// 	var domainStr2 = localStorage.getItem(domainKey);
		// 	console.log(JSON.parse(domainStr2));
		// });
		var domain = getDomain();
		console.log(domain);
		if (domain) {
			mui('#domain')[0].value = domain;
		}
	}(mui, window.app = {}));
	//域名设置
	function setDomain(){
		var domainVal = mui('#domain')[0].value;
		if (!domainVal) {
			mui.toast('域名未填写！',{ 
				duration:'long', type:'div',
			}); 
			return
		}
		if (domainVal.substring(0,4)!='http') {
			mui.toast('域名格式错误！',{ 
				duration:'long', type:'div',
			}); 
			return
		}
		cacheSet(domainKey, domainVal);
		mui.toast('更新成功！',{ 
			duration:'long', type:'div',
		});
	}
</script>